package com.tony.domain.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

/**
 * @author tony
 * @date 2020/5/30 18:22
 */
@Data
public class AdminUserDTO {

    /**
     * id
     */
    @ApiModelProperty(value = "id")
    private Long id;

    /**
     * 角色id
     */
    @NotNull
    @Min(value = 1)
    @ApiModelProperty(value = "角色id")
    private Long roleId;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    private String name;

    /**
     * 性别：1男，2女
     */
    @ApiModelProperty(value = "性别：1男，2女")
    private Integer sex;

    /**
     * 登陆名称
     */
    @NotBlank
    @Length(max = 50)
    @ApiModelProperty(value = "登陆名称")
    private String loginName;

    /**
     * 密码
     */
    @NotBlank
    @Length(min = 6, max = 12)
    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * 电话
     */
    @NotBlank
    @Pattern(regexp = "^1[0-9]{10}$")
    @ApiModelProperty(value = "电话")
    private String phone;

    /**
     * 电子邮箱地址
     */
    @Email
    @ApiModelProperty(value = "电子邮箱地址")
    private String email;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    private String headPortrait;
}
